import path, { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import basicSSL from '@vitejs/plugin-basic-ssl'
import fs from 'fs'
import vue from '@vitejs/plugin-vue'

export default defineConfig({
  main: {
    plugins: [externalizeDepsPlugin()]
  },
  preload: {
    plugins: [externalizeDepsPlugin()]
  },

  renderer: {
    server: {
      // https: {
      //   key: fs.readFileSync(path.join(__dirname, './cert.key')),
      //   cert: fs.readFileSync(path.join(__dirname, './cert.crt'))
      // },
      host: true
    },
    resolve: {
      alias: {
        '@renderer': resolve('src/renderer/src')
      }
    },
    plugins: [vue()]
  }
})
